package struct.enums;

public enum OrderType {
    ASC,
    DESC;

    public static OrderType fromString(String typeStr) {
        for (OrderType type : OrderType.values()) {
            if (type.name().equalsIgnoreCase(typeStr)) {
                return type;
            }
        }
        throw new IllegalArgumentException("No constant with text " + typeStr + " found");
    }
}
